import request from '@/utils/request'

// 查询合作商管理列表
export function listPartners(query) {
  return request({
    url: '/admin/SPartners/partnerList',
    method: 'get',
    params: query
  })
}

// 查询合作商管理详细
export function getPartners(partnersId) {
  return request({
    url: '/admin/SPartners/partnerDetails/partners/' + partnersId,
    method: 'get'
  })
}

// 新增合作商管理
export function addPartners(data) {
  return request({
    url: '/admin/SPartners/partnerAdd',
    method: 'post',
    data: data
  })
}

// 修改合作商管理
export function updatePartners(data) {
  return request({
    url: '/admin/SPartners/partnerEdit',
    method: 'put',
    data: data
  })
}

// 删除合作商管理
export function delPartners(partnersId) {
  return request({
    url: '/admin/SPartners/partnerDel/partners/' + partnersId,
    method: 'delete'
  })
}

// 选择地址
export function chooseAddressList() {
  return request({
    url: '/admin/SysConfig/chooseAddress',
    method: 'get'
  })
}

// 合作商状态修改
export function changePartnersStatus(partnersId, status) {
  const data = {
    partnersId,
    status
  }
  return request({
    url: '/admin/SPartners/changePartnersStatus',
    method: 'put',
    data: data
  })
}

